<template>
  <div class="dashboard-container">
    <div class="dashboard-text">
      <!-- 测试 -->
      <el-button @click="hAddRouter">addRouter</el-button>
      <hr>

      name: {{ name }}
      <el-button type="primary" @click="btn">使用sync</el-button>
    </div>
    <hr>
    <dia :visible="dialogVisible" />
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import dia from './dia.vue'
export default {
  name: 'Dashboard',
  components: {
    dia
  },
  data() {
    return {
      dialogVisible: false
    }
  },
  computed: {
    ...mapGetters(['name'])
  },

  methods: {
    hAddRouter() {
      console.log(1)
      this.$router.addRoutes([
        {
          path: '/abc',
          component: () => import('@/views/abc/abc.vue')
        }
      ])
    },
    btn() {
      this.dialogVisible = true
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
